In the data processing environment, hardware resources are shared among a plurality of software applications executing in the system. It is not uncommon for more than one application to simultaneously require the same hardware resource. Since more than one application cannot use the same hardware resource simultaneously, means must be provided to overcome this contention problem. Various techniques have been proposed to overcome this hardware contingent problem.
In one approach, a priority level is assigned to each contending application that wishes to use the hardware resources of the system. When two or more applications require simultaneous execution, a determination is made as to which application has the highest priority. The application with the highest priority is then allowed to execute using the required hardware resources. The lower priority application then waits until the hardware resources are no longer required by the highest priority application before executing. A problem with this approach is that it tends to favor higher priority applications over lower priority applications, thereby delaying the execution of low priority applications significantly.
One technique for overcoming this problem is to grant priority to an application in accordance with the length of time that an application has been waiting to be executed in comparison with other waiting applications. In another known technique, priority is granted to the application having the shortest anticipated execution time. For example, in U.S. Pat. No. 4,096,571, a processor's waiting time is minimized by precluding any processor from reaching the memory twice before another processor which has in the meantime requested the memory reaches it once. In yet another approach disclosed in U.S. Pat. No. 4,481,583, programs are executed through a series of processing intervals. After each interval, the priority of the executing program is lowered in proportion to the amount of resources consumed. After each processing interval, the priorities are recalculated for all programs competing for access to the same resources.
In U.S. Pat. No. 4,514,728, the problem of low priority lockout is addressed. Low priority lockout can occur for example when two high priority devices alternate in contention for the same resource simultaneously with a lower priority device. These contentions are never resolved in favor of the lower priority device, thereby locking it out from access to the required resource. In accordance with this patent, all requests at a given time for a resource are stored. No further requests are honored until each device associated with a stored request is granted access to the resource. In this manner, the lower priority device is not locked out.
A problem not addressed by the prior art occurs when a user desires to start an application that preempts the resources currently being used by another application. Means must be provided to determine which resources each application requires and which resources are currently available. Additionally, the user must be warned if an application is about to terminate because its resources are rquired to run another application. Additionally, provision must be made for the interrupted application to be allowed to continue to execute following the completion of the interrupting application. In an environment when more than one application can run at a time, then means must still be provided to keep track of the required resources and to allocate them among the functioning applications. Finally, it would be most desirable to enable a system to detect conflicting usages by competing applications of the same hardware resources in such a manner to enable the system to help the user make the correct decision as to which application to execute first.